#include <iostream>
#include "person.h"

void func1(Person* p) {
  p->set_name("Gizmosan");
}

void func2(Person*& p) {
  p= new Person(27, "Halit");
}

void func3(Person p){
  p.set_name("Gizem");
} 


void func4(Person& p){
  p.set_name("Gizem");
}

int main() {  
  Person* gizem = new Person(1524, "Gizem");
  std::cout << gizem->get_name() << std::endl;
  func1(gizem);
  std::cout << gizem->get_name() << std::endl;
  Person* whoever;
  func2(whoever);
  std::cout << whoever->get_name() << std::endl;
  func4(*whoever);
  std::cout <<"change: "<< whoever->get_name()<< std::endl;
  delete gizem;
  delete whoever;
  Person p1(7,"Halit");
  std::cout << p1.get_name()<< std::endl;
  func3(p1);
  std::cout << p1.get_name()<< std::endl;
  func4(p1);
  std::cout << p1.get_name()<< std::endl;
  func1(&p1);
  std::cout << p1.get_name()<< std::endl;
}

